load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "tikv",
    srcs = [
        "deadlock.go",
        "detector.go",
        "inner_server.go",
        "mock_region.go",
        "mvcc.go",
        "region.go",
        "server.go",
        "server_batch.go",
        "util.go",
        "write.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/store/mockstore/unistore/tikv",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/kv",
        "//pkg/store/mockstore/unistore/client",
        "//pkg/store/mockstore/unistore/config",
        "//pkg/store/mockstore/unistore/cophandler",
        "//pkg/store/mockstore/unistore/lockstore",
        "//pkg/store/mockstore/unistore/metrics",
        "//pkg/store/mockstore/unistore/pd",
        "//pkg/store/mockstore/unistore/tikv/dbreader",
        "//pkg/store/mockstore/unistore/tikv/kverrors",
        "//pkg/store/mockstore/unistore/tikv/mvcc",
        "//pkg/store/mockstore/unistore/tikv/pberror",
        "//pkg/store/mockstore/unistore/util/lockwaiter",
        "//pkg/tablecodec",
        "//pkg/types",
        "//pkg/util/codec",
        "//pkg/util/rowcodec",
        "@com_github_dgryski_go_farm//:go-farm",
        "@com_github_gogo_protobuf//proto",
        "@com_github_google_btree//:btree",
        "@com_github_pingcap_badger//:badger",
        "@com_github_pingcap_badger//y",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_kvproto//pkg/coprocessor",
        "@com_github_pingcap_kvproto//pkg/deadlock",
        "@com_github_pingcap_kvproto//pkg/errorpb",
        "@com_github_pingcap_kvproto//pkg/kvrpcpb",
        "@com_github_pingcap_kvproto//pkg/metapb",
        "@com_github_pingcap_kvproto//pkg/mpp",
        "@com_github_pingcap_kvproto//pkg/pdpb",
        "@com_github_pingcap_kvproto//pkg/tikvpb",
        "@com_github_pingcap_log//:log",
        "@com_github_pingcap_tipb//go-tipb",
        "@com_github_tikv_client_go_v2//oracle",
        "@com_github_tikv_pd_client//:client",
        "@org_golang_google_grpc//:grpc",
        "@org_golang_google_grpc//credentials/insecure",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "tikv_test",
    timeout = "short",
    srcs = [
        "detector_test.go",
        "main_test.go",
        "mvcc_test.go",
    ],
    embed = [":tikv"],
    flaky = True,
    shard_count = 28,
    deps = [
        "//pkg/store/mockstore/unistore/config",
        "//pkg/store/mockstore/unistore/lockstore",
        "//pkg/store/mockstore/unistore/tikv/kverrors",
        "//pkg/store/mockstore/unistore/tikv/mvcc",
        "//pkg/store/mockstore/unistore/util/lockwaiter",
        "//pkg/testkit/testsetup",
        "@com_github_pingcap_badger//:badger",
        "@com_github_pingcap_badger//y",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_kvproto//pkg/deadlock",
        "@com_github_pingcap_kvproto//pkg/kvrpcpb",
        "@com_github_pingcap_kvproto//pkg/metapb",
        "@com_github_stretchr_testify//require",
        "@org_uber_go_goleak//:goleak",
    ],
)
